package com.example.shengyin.dao;

import com.example.shengyin.entity.Comment;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;


@Service
public interface CommentMapper {
    public int userInsert(Comment comment);


    // 返回文章id的所有的评论
    public List<Comment> comNum(@Param("articleid") Long articleid);

    // 返回文章id的所有评论的数量
    public Long countByarticleid(@Param("articleid") Long articleid);

    // 根据评论id查它的userid
    public Long selectUseridById(@Param("id")Long id);
    public List<Comment> list(@Param("pagestart")int pagestart, @Param("limit") int limit, @Param("starttime") Date starttime, @Param("endtime")Date endtime,@Param("uname")String uname);



    public int update(Comment comment);


    public int delete(@Param("id") Long id);
    public int deleteByIds(@Param("ids") String ids);


    public int count(@Param("starttime") Date starttime,@Param("endtime")Date endtime,@Param("uname")String uname);
}
